home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
2510.ZIP
/
TRSOURCE.EXE
/
SAVESCR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-22
|
2KB
|
75 lines
/*********
* savescr.c by Leonard Zerman
* Placed in the public domain by Tom Rettig Associates, 10/22/1990.
*
* Syntax: SAVESCR( <expC>[, <expC>[,<expC>]])
* Return: <expL> .T.if saves else .F.
********/
#include "trlib.h"
TRTYPE savescr()
{
static char fnamebuff[66];
static char extention[] = ".SCN";
char * fname;
char * memvarptr;
char * coloropt;
char * scrptr;
int len, memvarlen;
int fhandle;
int i;
if (PCOUNT == 1 && ISCHAR(1) ||
(PCOUNT == 2 && ISCHAR(1) && ISCHAR(2)) ||
(PCOUNT == 3 && ISCHAR(1) && ISCHAR(2) && ISCHAR(3)))
{
fname = _parc(1);
memvarlen = 0;
if (PCOUNT > 1)
{
memvarptr = _parc(2);
memvarlen = _parclen(2);
}
if (PCOUNT == 3)
coloropt = _parc(3);
len = _tr_strlen(fname);
_tr_strcpy(fnamebuff,fname);
for(i = 0;i < len && fnamebuff[i] != '.'; i++)
;
if (i == len)
_tr_strcat(fnamebuff,extention);
fhandle = _tr_creat(fnamebuff,0);
if (fhandle == ERRORNEG)
{
_retl(FALSE);
return;
}
if (_tr_iscolor())
scrptr = MK_FP(COLOR_VID_AD,0);
else
scrptr = MK_FP(MONO_VID_AD,0);
if (PCOUNT == 3)
{
if(toupper(*coloropt) == 'G')
{
scrptr = MK_FP(COLOR_VID_AD,0);
}
}
if (PCOUNT > 1 && memvarlen)
scrptr = memvarptr;
_tr_write(fhandle,scrptr,4000);
_tr_close(fhandle);
_retl(TRUE);
}
else
_retl(FALSE);
}
/*********************** eof savescr ***************************************/